package cn.bevisoft.casex.web.controller;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.bevisoft.casex.biz.manager.UserMananger;

@Controller
@RequestMapping("/")
public class DemoController {
	
	private static final Logger log = LoggerFactory.getLogger(DemoController.class);
	
	@Autowired
	@Resource(name="userMananger")
	private UserMananger userMananger;
	
	
	@RequestMapping("/showDemo.htmlx")
	public ModelAndView showDemoTime() {
		log.info("showDemoTime");
		
		Map<String,Object> resultMap = new HashMap<String,Object>();
		resultMap.put("p1", new Date());
		resultMap.put("p2", this.userMananger.getUserByUsernameAndPassword("xubo", "pp"));
		
		
		return new ModelAndView("showDemo",resultMap);
	}

}
